package com.wit.WEB.service.impl;

import com.wit.WEB.entity.Order_;
import com.wit.WEB.mapper.Order_Mapper;
import com.wit.WEB.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: java-web-group
 * @description: 订单实现类
 * @author: KingTeng
 * @create: 2022-03-08 10:44
 **/
@Service
public class OrderServiceimpl implements OrderService {
    private Order_Mapper order_mapper;
    @Autowired
    private void setOrder_mapper(Order_Mapper order_mapper){
        this.order_mapper=order_mapper;
    }

    @Override
    public void addOrder(Order_ order) {
        order_mapper.insertSelective(order);
    }

    @Override
    public List<Order_> findallByUid(Integer uid) {
        return order_mapper.findAllByUid(uid);
    }

    @Override
    public List<Order_> findallByConfirmNone(Integer tid) {
        return order_mapper.findallByConfirmNone(tid);
    }

    @Override
    public List<Order_> findallByConfirmOk(Integer tid) {
        return order_mapper.findallByConfirmOk(tid);
    }

    @Override
    public List<Order_> findall() {
        return order_mapper.findAll();
    }

    @Override
    public Order_ selectOrderbyprimary(Integer oid) {
        return order_mapper.selectByPrimaryKey(oid);
    }

    @Override
    public int updateByprimary(Order_ order) {
        return  order_mapper.updateByPrimaryKeySelective(order);
    }
}
